how to calculate prime factors of a number